package com.taoxue.controllers;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView;

import com.taoxue.services.TestService;

@Controller
@RequestMapping("/")
public class TestController {
	@Autowired
	private TestService testService;
	@ResponseBody
	@RequestMapping(value="{CountryID}.do")
	@Transactional
	public String test(Model model){
		testService.test();
		return "success";
	}
	@ResponseBody
	@RequestMapping(value="my.do")
	public ModelAndView redirect(){
		
		return new ModelAndView(new RedirectView("test.do"));
	}
	@RequestMapping(value="test.json")
	public String testJson(){
		return "/a.jsp";
	}
}
